package hk.com.fwd.web.rest;

import com.github.pagehelper.PageInfo;
import hk.com.fwd.biz.AcsCommonBo;
import hk.com.fwd.biz.PolicyItemAdjustmentTestBo;
import hk.com.fwd.biz.exception.DmsException;
import hk.com.fwd.model.PageBean;
import hk.com.fwd.model.PolicyAdjDualControlDTO;
import hk.com.fwd.model.PolicyItemAdjustmentSearchResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;


@RestController
public class PolicyItemAdjustmentRestTestController extends BaseRestController {

    @Autowired
    private AcsCommonBo acsCommonBo;

    @Autowired
    private PolicyItemAdjustmentTestBo policyItemAdjustmentBo;


    @RequestMapping(value = "/policyItemAdjustment/searchPolicyItemAdjustmenttest", method = RequestMethod.POST)
    public PageInfo searchPolicyItemAdjustment(@RequestBody PageBean<PolicyItemAdjustmentSearchResultDTO> pageBean) throws DmsException {
        return policyItemAdjustmentBo.searchPolicyItemAdjustment(pageBean);
    }

    @RequestMapping(value = "/policyItemAdjustment/createPolicyItemAdjustmenttest", method = RequestMethod.POST)
    public int createPolicyItemAdjustment(@RequestBody @Valid PolicyAdjDualControlDTO policyAdjDualControlDTO) throws DmsException {
        return 0;
    }

    @RequestMapping(value = "/policyItemAdjustment/addtest", method = RequestMethod.POST)
    public int add() throws DmsException {
        throw new DmsException("I-CMN-001");

    }

    @RequestMapping(value = "/policyItemAdjustment/update", method = RequestMethod.POST)
    public int update() throws DmsException {
        return 0;
    }

    @RequestMapping(value = "/policyItemAdjustment/deletetest", method = RequestMethod.POST)
    public int delete() throws DmsException {
        return 0;
    }

}
